Skip to content

Conversation

@OTapio
Copy link

@OTapio OTapio commented Apr 5, 2020

Created ResNet-18 for Flux. It does function but still needs some work. Has issues with speed and memory consumption. Feedback would be appreciated.

@DhairyaLGandhi
Copy link
Member

Might be better as a PR to Metalhead, to make it capable of emitting common Resnets The default is ResNet50, but it should be able to emit the kinds we may want.

MeanPool((7,7)),
x -> reshape(x, :, size(x,4)),
Dense(512*1, 10),
softmax,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should remove the softmax here since you are using logicrossentropy

end


loss(x, y) = sum(logitcrossentropy(m(x), y))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not wrong, logitcrossentropy already performs reduction, no need for sum

Comment on lines +130 to +132
SkipConnection(identity_layer(512), (variable_1, variable_2) -> variable_1 + variable_2),
MeanPool((7,7)),
x -> reshape(x, :, size(x,4)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't these anonymous functions have names?

Suggested change
SkipConnection(identity_layer(512), (variable_1, variable_2) -> variable_1 + variable_2),
MeanPool((7,7)),
x -> reshape(x, :, size(x,4)),
SkipConnection(identity_layer(512), +),
MeanPool((7,7)),
Flux.flatten,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants